-
-
Notifications
You must be signed in to change notification settings - Fork 43
Remove Base.convert methods between AbstractString and Kind
#500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This patch removes the method `convert(::Type{String}, ::Kind)` used for
converting kinds to strings and replaces it with the already existing
method of `Base.string`. There are two reason for this: i) the method
causes invalidations when loading the package and ii) `convert` is
called implicitly in e.g. constructors and should therefore typically
only be defined between similar enough types.
This patch removes the method `Base.convert(::Type{Kind}, ::AbstractString)`
and replaces it with a `Kind(::AbstractString)` constructor. The reason
for this is that `convert` is called implicitly in e.g. constructors and
should therefore typically only be defined between similar enough types.
|
This seems worth doing to me. julia> push!(["a"], K"=")
2-element Vector{String}:
"a"
"=" |
c42f
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems great, thanks :)
|
For context, |
|
Is squash merge okay? |
|
I generally prefer squash merge and I think it's a good default. Some exceptions where an actual merge commit can be worthwhile:
|
Enums doesn't have any converts like this either though? |
…liaLang/JuliaSyntax.jl#500) * Remove the method `convert(::Type{String}, ::Kind)` This patch removes the method `convert(::Type{String}, ::Kind)` used for converting kinds to strings and replaces it with the already existing method of `Base.string`. There are two reason for this: i) the method causes invalidations when loading the package and ii) `convert` is called implicitly in e.g. constructors and should therefore typically only be defined between similar enough types. * Remove the method `Base.convert(::Type{Kind}, ::String)` This patch removes the method `Base.convert(::Type{Kind}, ::AbstractString)` and replaces it with a `Kind(::AbstractString)` constructor. The reason for this is that `convert` is called implicitly in e.g. constructors and should therefore typically only be defined between similar enough types.
No description provided.